<?php if (!defined('SERVER_ROOT')) {exit('No direct script access allowed');}
//header
$this->template->title = 'Danh mục cán bộ';
$this->template->display('dsp_header.php');
?>
 <form name="frmMain" id="frmMain" action="" method="POST">
    <?php
    echo $this->hidden('controller',$this->get_controller_url());
    echo $this->hidden('hdn_item_id','0');
    echo $this->hidden('hdn_item_id_list','');
    echo $this->hidden('hdn_dsp_single_method','dsp_single_canbo');
    echo $this->hidden('hdn_dsp_all_method','dsp_all_canbo');
    echo $this->hidden('hdn_update_method','update_canbo');
    echo $this->hidden('hdn_delete_method','delete_canbo');
    $v_row = 0;
    ?>
    <h3 style="text-align:center;text-transform: uppercase">DANH SÁCH CÁN BỘ ĐẾN TUỖI NGHĨ HƯU</h3>
    <div id="div_filter">
        <input class = 'button' type="button" name="btn_add_canbo" value="In danh sách" onclick="location.href='<?php echo SITE_ROOT . 'qlcb/canbo/dsp_single_canbo/&m=0'?>'"/>
	</div>
    <table  width="100%" class="adminlist" cellspacing="0" border="1">
        <colgroup>
            <col width="10%" />
            <col width="20%" />
            <col width="10%" />
            <col width="20%" />
            <col width="10%" />
            <col width="20%" />
            <col width="10%" />
        </colgroup>
        <tr>
            <th>Mã cán bộ</th>
            <th>Tên cán bộ</th>
            <th>Giới tính</th>
            <th>Ngày sinh</th>
            <th>Tuổi</th>
            <th>Ngày nghĩ hưu</th>
            <th>Thao tác</th>
        </tr>
         <?php while ($arr = $arr_all_canbo->FetchRow()): ?>
            <?php
             $MA_CAN_BO=$arr['MA_CAN_BO'];
             $TEN_CAN_BO=$arr['TEN_CAN_BO'];
             $TEN_GIOI_TINH=$arr['TEN_GIOI_TINH'];
             $NGAY_SINH=$arr['NGAY_SINH2'];
             $TUOI=$arr['TUOI'];
             $NGAY_NGHI_HUU = $arr['NGAY_NGHI_HUU2'];
             $v_class = 'row' . ($v_row % 2);
             $v_row++;
             $v_link = SITE_ROOT . 'qlcb/canbonghihuu/dsp_single_canbo/&m=' . $MA_CAN_BO;
            ?>
            <tr class="<?php echo $v_class;?>">
                <td style="text-align:center"><?php echo $MA_CAN_BO;?></td>
               <td>
                    <a href="<?php echo $v_link;?>">
                            <?php echo $TEN_CAN_BO;?>
                    </a>
                </td>
                <td style="text-align:center"><?php echo $TEN_GIOI_TINH;?></td>
                <td style="text-align:center"><?php echo $NGAY_SINH;?></td>
                <td style="text-align:center"><?php echo $TUOI;?></td>
                <td style="text-align:center"><?php echo $NGAY_NGHI_HUU;?></td>
                <td style="text-align:center">
                    <?php if ($NGAY_NGHI_HUU==''): ?>
                    <a href="javascript:void(0)" onclick="nghihuu_click('<?php echo $MA_CAN_BO;?>','<?php echo $TEN_CAN_BO;?>')">Nghĩ hưu</a>
                     <?php endif; ?>
                </td>
            </tr>
        <?php endwhile; ?>
        <?php echo $this->add_empty_rows($v_row +1, _CONST_DEFAULT_ROWS_PER_PAGE, 7); ?>
    </table>

</form>
<script>
    function nghihuu_click(macanbo,tencanbo){
        var url = '<?php echo $this->get_controller_url();?>dsp_nghihuu/'  + macanbo
            url += '/?&macanbo=' + macanbo + '&tencanbo=' + tencanbo + '&pop_win=1';
        showPopWin(url ,500,250, null);
    }
</script>
<?php $this->template->display('dsp_footer.php');